#!/usr/bin/python
import time
import socket
import traceback

host = ''
port =  50000
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
s.bind((host,port))
 
try:
    client,addr = s.recvfrom(8192)

    #a = client.recvfrom(4096)
    print client 
    buf = "%s \n hello Liu xiang wei\n\t\t from Qinglua"% time.ctime()
    print addr
    s.sendto(client,addr)
    s.sendto(buf,(addr[0],addr[1])) 
except socket.error, e:
    print "some :%s " %e
except :
    traceback.print_exc()
    
